package com.ydgk.dao;

import com.ydgk.bean.Detail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DetailMapper {

    @Insert("insert into detail values(#{did},#{dphoto},#{f_fid})")
    int insert(Detail detail);

    @Delete("delete from detail where f_fid = #{fid}")
    void deleteByFid(int fid);

    @Select("select * from detail where f_fid = #{fid}")
    List<Detail> findByFid(int fid);

    @Delete("delete from detail where did = #{param1} and f_fid = #{param2}")
    int deleteByIdAndFid(int did,int fid);

    @Select("select * from detail where did = #{did}")
    Detail findById(int did);
}
